home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QRZ! Ham Radio 8
/
QRZ Ham Radio Callsign Database - Volume 8.iso
/
pc
/
files
/
ant_nec
/
nec_in_c.tz
/
nec_in_c
/
NEC2
/
cabs.c
< prev
next >
Wrap
Text File
|
1992-02-13
|
309b
|
22 lines
double cabs(real, imag)
double real, imag;
{
double temp, sqrt();
if(real < 0)
real = -real;
if(imag < 0)
imag = -imag;
if(imag > real){
temp = real;
real = imag;
imag = temp;
}
if((real+imag) == real)
return(real);
temp = imag/real;
temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/
return(temp);
}